#!/bin/sh

set -e

jenkins_dir=/data/jenkins192

wget -O jenkins.war http://updates.jenkins-ci.org/download/war/2.192/jenkins.war
cp jenkins.war ${jenkins_dir}/jenkins.war

cp timezone ${jenkins_dir}/mytimezone

docker run -d \
  --net host \
  --restart always \
  --privileged=true \
  -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \
  -v ${jenkins_dir}/mytimezone:/etc/timezone \
  -v ${jenkins_dir}:/var/jenkins_home \
  -v ${jenkins_dir}/jenkins.war:/usr/share/jenkins/jenkins.war \
  --env JAVA_OPTS=-Dfile.encoding=UTF-8 \
  jenkins/jenkins:lts
